﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
using ChinaDynastyTours.Controls;
using System.Threading;

namespace ChinaDynastyTours.Helpers
{
    public static class ApplicationHelper
    {
        /// <summary>
        /// 团费标识，用于‘计划收入’中‘团费’的标识，与bas_Customer中的CustomerName和Country字段需同名称（两者需同步）
        /// </summary>
        //public const string TourGroupPlanIncome = "TGPI";

        /// <summary>
        /// 合同的相对路径位置
        /// </summary>
        public static string AbsolutelyContractPath = System.Configuration.ConfigurationManager.AppSettings["ContractFilesPath"]; //Path.Combine(Application.StartupPath, "ContractFiles");
        /// <summary>
        /// 数据加载提示函数
        /// </summary>
        /// <param name="tipMsg"></param>
        /// <param name="parentControl"></param>
        /// <returns>DevExpress.Utils.ToolTipController类型</returns>
        public static DevExpress.Utils.ToolTipController ShowLoadTip(string tipMsg, Control parentControl)
        {
            DevExpress.Utils.ToolTipController tip = new DevExpress.Utils.ToolTipController();
            tip.ToolTipType = DevExpress.Utils.ToolTipType.SuperTip;
            tip.InitialDelay = 100000;
            tip.ShowHint(tipMsg, new Point(parentControl.Width / 2 + 100, parentControl.Height / 2 + 100));
            Application.DoEvents();
            return tip;
        }
        /// <summary>
        /// 获取当前登录用户的级别 0总经理,1部门领导,2普通员工
        /// </summary>
        public static int RankID
        {
            get
            {
                return UserInfoCtrl.GetUserInfoForRankID(Thread.CurrentPrincipal.Identity.Name);
            }
        }
    }
}
